<?php
extract ($data);
$span_class = (isset($data['children']) && count($data['children']) == 0 ) ? '' : 'dir';
$tree->addItemAttribute('class', $span_class); // highlight this li
echo $html->link($StoreCategory['name'],'#',array('escape'=>false,'class'=>$span_class));